package com.cnhis.cloudhealth.clinical.hosnurse.hosmedicine.bo;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cnhis.cloudhealth.clinical.hosnurse.hosmedicine.dao.HosMedicineDao;
import com.cnhis.cloudhealth.commons.Mappers.ModelVo;
import com.cnhis.cloudhealth.commons.utils.Page;
import com.cnhis.cloudhealth.commons.utils.StaticKeys;

@Service
public class HosMedicineBo {
  @Resource
  private HosMedicineDao hosMedicineDao;
  
  public ModelVo medicineAllergyHistory(Map map,int currPage,int pageSize)throws Exception{
	  ModelVo mo = new ModelVo();
		Page pg = null;
		try {
			pg = hosMedicineDao.medicineAllergyHistory(map, currPage, pageSize);
		} catch (Exception e) {
			e.printStackTrace();
			mo.setResult(StaticKeys.OH_FALSE);
			return mo;
		}
		
		mo.setList(pg.getList());
		mo.setResult(StaticKeys.OH_SUCCESS);
		mo.setRows(pg.getList());
		return mo;
  }
  public ModelVo queryMedicineOffice()throws Exception{
	  ModelVo mo = new ModelVo();
		List ls =null;
		try {
			ls=hosMedicineDao.queryMedicineOffice();
			
		} catch (Exception e) {
			e.printStackTrace();
			mo.setResult(StaticKeys.OH_FALSE);
			return mo;
		}
		mo.setList(ls);
		mo.setResult(StaticKeys.OH_SUCCESS);
		mo.setRows(ls);
		return mo;
  }
}
